/*
 * @Author: HeAo
 * @Date: 2021-09-28 14:08:01
 * @LastEditTime: 2021-09-28 14:25:37
 * @LastEditors: HeAo
 * @Description:
 * @FilePath: \web2103-2105\web2105\3-1-ES6\day04\1-class.js
 * 别乱动！
 */
// function Person(name,age) {
// this.name = name
// this.age = age
// }
// Person.prototype.sayName = function

// let people = new Person('tom', 12)

class Person {
  static weight = '50KG'
  constructor(name, age, gender) {
    this.name = name
    this.age = age
    this.gender = gender
  }
  sayName () {
    console.log('my name is', this.name);
  }
  sayAge () {
    console.log('my age is', this.age);
  }
  static sayWeight () {
    console.log('my weight is', this.weight);
  }
}

let tom = new Person('tom', 20, '男')
console.log(tom);
// 调用实例方法
tom.sayName()
tom.sayAge()
// 访问静态属性
console.log(Person.weight);
// 调用静态方法
Person.sayWeight()

